/*
 * Intel ACPI Component Architecture
 * AML/ASL+ Disassembler version 20161210-64(RM)
 * Copyright (c) 2000 - 2016 Intel Corporation
 * 
 * Disassembling to non-symbolic legacy ASL operators
 *
 * Disassembly of SSDT-IGPU.aml, Sun Nov 12 16:19:41 2017
 *
 * Original Table Header:
 *     Signature        "SSDT"
 *     Length           0x00001096 (4246)
 *     Revision         0x02
 *     Checksum         0xAF
 *     OEM ID           "hack"
 *     OEM Table ID     "IGPU"
 *     OEM Revision     0x00000000 (0)
 *     Compiler ID      "INTL"
 *     Compiler Version 0x20160422 (538313762)
 */
DefinitionBlock ("", "SSDT", 2, "hack", "IGPU", 0x00000000)
{
    External (_SB_.PCI0.IGPU, DeviceObj)    // (from opcode)
    External (RMCF.HIGH, IntObj)    // (from opcode)
    External (RMCF.IGPI, IntObj)    // (from opcode)
    External (RMCF.TYPE, IntObj)    // (from opcode)

    Scope (_SB.PCI0.IGPU)
    {
        OperationRegion (RMP1, PCI_Config, Zero, 0x14)
        Field (RMP1, AnyAcc, NoLock, Preserve)
        {
            Offset (0x02), 
            GDID,   16, 
            Offset (0x10), 
            BAR1,   32
        }

        Name (LAPL, Package (0x10)
        {
            0x0116, 
            0x0126, 
            Zero, 
            Package (0x08)
            {
                "AAPL,snb-platform-id", 
                Buffer (0x04)
                {
                     0x00, 0x00, 0x01, 0x00                         
                }, 

                "model", 
                Buffer (0x17)
                {
                    "Intel HD Graphics 3000"
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }, 

                "AAPL,os-info", 
                Buffer (0x14)
                {
                    /* 0000 */  0x30, 0x49, 0x01, 0x11, 0x11, 0x11, 0x08, 0x00,
                    /* 0008 */  0x00, 0x01, 0xF0, 0x1F, 0x01, 0x00, 0x00, 0x00,
                    /* 0010 */  0x10, 0x07, 0x00, 0x00                         
                }
            }, 

            0x0166, 
            Zero, 
            Package (0x06)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x03, 0x00, 0x66, 0x01                         
                }, 

                "model", 
                Buffer (0x17)
                {
                    "Intel HD Graphics 4000"
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }
            }, 

            0x0A1E, 
            Zero, 
            Package (0x08)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x06, 0x00, 0x26, 0x0A                         
                }, 

                "model", 
                Buffer (0x17)
                {
                    "Intel HD Graphics 4200"
                }, 

                "device-id", 
                Buffer (0x04)
                {
                     0x12, 0x04, 0x00, 0x00                         
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }
            }, 

            0x0A16, 
            Zero, 
            Package (0x08)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x06, 0x00, 0x26, 0x0A                         
                }, 

                "model", 
                Buffer (0x17)
                {
                    "Intel HD Graphics 4400"
                }, 

                "device-id", 
                Buffer (0x04)
                {
                     0x12, 0x04, 0x00, 0x00                         
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }
            }, 

            0x0416, 
            Zero, 
            Package (0x08)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x06, 0x00, 0x26, 0x0A                         
                }, 

                "model", 
                Buffer (0x17)
                {
                    "Intel HD Graphics 4600"
                }, 

                "device-id", 
                Buffer (0x04)
                {
                     0x12, 0x04, 0x00, 0x00                         
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }
            }
        })
        Name (LAPH, Package (0x15)
        {
            0x0116, 
            0x0126, 
            Zero, 
            Package (0x0A)
            {
                "AAPL,snb-platform-id", 
                Buffer (0x04)
                {
                     0x00, 0x00, 0x01, 0x00                         
                }, 

                "AAPL00,DualLink", 
                Buffer (0x04)
                {
                     0x01, 0x00, 0x00, 0x00                         
                }, 

                "model", 
                Buffer (0x17)
                {
                    "Intel HD Graphics 3000"
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }, 

                "AAPL,os-info", 
                Buffer (0x14)
                {
                    /* 0000 */  0x30, 0x49, 0x01, 0x11, 0x11, 0x11, 0x08, 0x00,
                    /* 0008 */  0x00, 0x01, 0xF0, 0x1F, 0x01, 0x00, 0x00, 0x00,
                    /* 0010 */  0x10, 0x07, 0x00, 0x00                         
                }
            }, 

            0x0166, 
            Zero, 
            Package (0x06)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x04, 0x00, 0x66, 0x01                         
                }, 

                "model", 
                Buffer (0x17)
                {
                    "Intel HD Graphics 4000"
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }
            }, 

            0x0A1E, 
            Zero, 
            Package (0x08)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x08, 0x00, 0x2E, 0x0A                         
                }, 

                "model", 
                Buffer (0x17)
                {
                    "Intel HD Graphics 4200"
                }, 

                "device-id", 
                Buffer (0x04)
                {
                     0x12, 0x04, 0x00, 0x00                         
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }
            }, 

            0x0A16, 
            Zero, 
            Package (0x08)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x08, 0x00, 0x2E, 0x0A                         
                }, 

                "model", 
                Buffer (0x17)
                {
                    "Intel HD Graphics 4400"
                }, 

                "device-id", 
                Buffer (0x04)
                {
                     0x12, 0x04, 0x00, 0x00                         
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }
            }, 

            0x0416, 
            Zero, 
            Package (0x08)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x08, 0x00, 0x2E, 0x0A                         
                }, 

                "model", 
                Buffer (0x17)
                {
                    "Intel HD Graphics 4600"
                }, 

                "device-id", 
                Buffer (0x04)
                {
                     0x12, 0x04, 0x00, 0x00                         
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }
            }, 

            0x0A26, 
            0x0A2E, 
            0x0D26, 
            Zero, 
            Package (0x04)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x08, 0x00, 0x2E, 0x0A                         
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }
            }
        })
        Name (LAPG, Package (0x0E)
        {
            0x161E, 
            Zero, 
            Package (0x06)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x04, 0x00, 0x26, 0x16                         
                }, 

                "model", 
                Buffer (0x17)
                {
                    "Intel HD Graphics 5300"
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }
            }, 

            0x1616, 
            Zero, 
            Package (0x06)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x04, 0x00, 0x26, 0x16                         
                }, 

                "model", 
                Buffer (0x17)
                {
                    "Intel HD Graphics 5500"
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }
            }, 

            0x1612, 
            Zero, 
            Package (0x06)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x04, 0x00, 0x26, 0x16                         
                }, 

                "model", 
                Buffer (0x17)
                {
                    "Intel HD Graphics 5600"
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }
            }, 

            0x1626, 
            0x162B, 
            0x1622, 
            Zero, 
            Package (0x04)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x04, 0x00, 0x26, 0x16                         
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }
            }
        })
        Name (DESK, Package (0x35)
        {
            0x161E, 
            Zero, 
            Package (0x06)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x02, 0x00, 0x16, 0x16                         
                }, 

                "model", 
                Buffer (0x17)
                {
                    "Intel HD Graphics 5300"
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }
            }, 

            0x1616, 
            Zero, 
            Package (0x06)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x02, 0x00, 0x16, 0x16                         
                }, 

                "model", 
                Buffer (0x17)
                {
                    "Intel HD Graphics 5500"
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }
            }, 

            0x1612, 
            Zero, 
            Package (0x06)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x02, 0x00, 0x16, 0x16                         
                }, 

                "model", 
                Buffer (0x17)
                {
                    "Intel HD Graphics 5600"
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }
            }, 

            0x1626, 
            0x162B, 
            0x1622, 
            Zero, 
            Package (0x04)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x02, 0x00, 0x16, 0x16                         
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }
            }, 

            0x191E, 
            Zero, 
            Package (0x0A)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x00, 0x00, 0x1E, 0x19                         
                }, 

                "model", 
                Buffer (0x16)
                {
                    "Intel HD Graphics 515"
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }, 

                "RM,device-id", 
                Buffer (0x04)
                {
                     0x1E, 0x19, 0x00, 0x00                         
                }, 

                "AAPL,GfxYTile", 
                Buffer (0x04)
                {
                     0x01, 0x00, 0x00, 0x00                         
                }
            }, 

            0x1916, 
            Zero, 
            Package (0x0A)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x02, 0x00, 0x16, 0x19                         
                }, 

                "model", 
                Buffer (0x16)
                {
                    "Intel HD Graphics 520"
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }, 

                "RM,device-id", 
                Buffer (0x04)
                {
                     0x16, 0x19, 0x00, 0x00                         
                }, 

                "AAPL,GfxYTile", 
                Buffer (0x04)
                {
                     0x01, 0x00, 0x00, 0x00                         
                }
            }, 

            0x1912, 
            Zero, 
            Package (0x0A)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x02, 0x00, 0x16, 0x19                         
                }, 

                "model", 
                Buffer (0x16)
                {
                    "Intel HD Graphics 530"
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }, 

                "RM,device-id", 
                Buffer (0x04)
                {
                     0x12, 0x19, 0x00, 0x00                         
                }, 

                "AAPL,GfxYTile", 
                Buffer (0x04)
                {
                     0x01, 0x00, 0x00, 0x00                         
                }
            }, 

            0x191B, 
            Zero, 
            Package (0x0C)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x00, 0x00, 0x1B, 0x19                         
                }, 

                "model", 
                Buffer (0x16)
                {
                    "Intel HD Graphics 530"
                }, 

                "device-id", 
                Buffer (0x04)
                {
                     0x1B, 0x19, 0x00, 0x00                         
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }, 

                "RM,device-id", 
                Buffer (0x04)
                {
                     0x1B, 0x19, 0x00, 0x00                         
                }, 

                "AAPL,GfxYTile", 
                Buffer (0x04)
                {
                     0x01, 0x00, 0x00, 0x00                         
                }
            }, 

            0x1926, 
            Zero, 
            Package (0x08)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x02, 0x00, 0x26, 0x19                         
                }, 

                "model", 
                Buffer (0x18)
                {
                    "Intel Iris Graphics 540"
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }, 

                "RM,device-id", 
                Buffer (0x04)
                {
                     0x26, 0x19, 0x00, 0x00                         
                }
            }, 

            0x1927, 
            Zero, 
            Package (0x0A)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x02, 0x00, 0x26, 0x19                         
                }, 

                "model", 
                Buffer (0x18)
                {
                    "Intel Iris Graphics 550"
                }, 

                "device-id", 
                Buffer (0x04)
                {
                     0x26, 0x19, 0x00, 0x00                         
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }, 

                "RM,device-id", 
                Buffer (0x04)
                {
                     0x26, 0x19, 0x00, 0x00                         
                }
            }, 

            0x193B, 
            Zero, 
            Package (0x08)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x05, 0x00, 0x3B, 0x19                         
                }, 

                "model", 
                Buffer (0x1C)
                {
                    "Intel Iris Pro Graphics 580"
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }, 

                "RM,device-id", 
                Buffer (0x04)
                {
                     0x3B, 0x19, 0x00, 0x00                         
                }
            }, 

            0x591E, 
            Zero, 
            Package (0x0C)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x00, 0x00, 0x1E, 0x59                         
                }, 

                "model", 
                Buffer (0x16)
                {
                    "Intel HD Graphics 515"
                }, 

                "device-id", 
                Buffer (0x04)
                {
                     0x1E, 0x59, 0x00, 0x00                         
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }, 

                "RM,device-id", 
                Buffer (0x04)
                {
                     0x1E, 0x59, 0x00, 0x00                         
                }, 

                "AAPL,GfxYTile", 
                Buffer (0x04)
                {
                     0x01, 0x00, 0x00, 0x00                         
                }
            }, 

            0x5916, 
            Zero, 
            Package (0x0C)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x00, 0x00, 0x16, 0x59                         
                }, 

                "model", 
                Buffer (0x16)
                {
                    "Intel HD Graphics 620"
                }, 

                "device-id", 
                Buffer (0x04)
                {
                     0x16, 0x59, 0x00, 0x00                         
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }, 

                "RM,device-id", 
                Buffer (0x04)
                {
                     0x16, 0x59, 0x00, 0x00                         
                }, 

                "AAPL,GfxYTile", 
                Buffer (0x04)
                {
                     0x01, 0x00, 0x00, 0x00                         
                }
            }, 

            0x5912, 
            Zero, 
            Package (0x0C)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x02, 0x00, 0x16, 0x59                         
                }, 

                "model", 
                Buffer (0x16)
                {
                    "Intel HD Graphics 630"
                }, 

                "device-id", 
                Buffer (0x04)
                {
                     0x12, 0x59, 0x00, 0x00                         
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }, 

                "RM,device-id", 
                Buffer (0x04)
                {
                     0x12, 0x59, 0x00, 0x00                         
                }, 

                "AAPL,GfxYTile", 
                Buffer (0x04)
                {
                     0x01, 0x00, 0x00, 0x00                         
                }
            }, 

            0x591B, 
            Zero, 
            Package (0x0C)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x00, 0x00, 0x1B, 0x59                         
                }, 

                "model", 
                Buffer (0x16)
                {
                    "Intel HD Graphics 630"
                }, 

                "device-id", 
                Buffer (0x04)
                {
                     0x1B, 0x59, 0x00, 0x00                         
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }, 

                "RM,device-id", 
                Buffer (0x04)
                {
                     0x1B, 0x59, 0x00, 0x00                         
                }, 

                "AAPL,GfxYTile", 
                Buffer (0x04)
                {
                     0x01, 0x00, 0x00, 0x00                         
                }
            }, 

            0x5926, 
            Zero, 
            Package (0x0A)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x02, 0x00, 0x26, 0x59                         
                }, 

                "model", 
                Buffer (0x1D)
                {
                    "Intel Iris Plus Graphics 640"
                }, 

                "device-id", 
                Buffer (0x04)
                {
                     0x26, 0x59, 0x00, 0x00                         
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }, 

                "RM,device-id", 
                Buffer (0x04)
                {
                     0x26, 0x59, 0x00, 0x00                         
                }
            }, 

            0x5927, 
            Zero, 
            Package (0x0A)
            {
                "AAPL,ig-platform-id", 
                Buffer (0x04)
                {
                     0x02, 0x00, 0x26, 0x59                         
                }, 

                "model", 
                Buffer (0x1D)
                {
                    "Intel Iris Plus Graphics 650"
                }, 

                "device-id", 
                Buffer (0x04)
                {
                     0x26, 0x59, 0x00, 0x00                         
                }, 

                "hda-gfx", 
                Buffer (0x0A)
                {
                    "onboard-1"
                }, 

                "RM,device-id", 
                Buffer (0x04)
                {
                     0x26, 0x59, 0x00, 0x00                         
                }
            }
        })
        Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
        {
            If (LNot (Arg2))
            {
                Return (Buffer (One)
                {
                     0x03                                           
                })
            }

            Store (Ones, Local1)
            If (CondRefOf (\RMCF.TYPE))
            {
                If (LEqual (One, \RMCF.TYPE))
                {
                    If (CondRefOf (\RMCF.HIGH))
                    {
                        If (LEqual (Zero, \RMCF.HIGH))
                        {
                            Store (LAPL, Local0)
                            Store (Match (Local0, MEQ, GDID, MTR, Zero, Zero), Local1)
                        }
                        ElseIf (LEqual (One, \RMCF.HIGH))
                        {
                            Store (LAPH, Local0)
                            Store (Match (Local0, MEQ, GDID, MTR, Zero, Zero), Local1)
                        }
                    }
                    Else
                    {
                        Store (LAPL, Local0)
                        Store (Match (Local0, MEQ, GDID, MTR, Zero, Zero), Local1)
                    }

                    If (LEqual (Ones, Local1))
                    {
                        Store (LAPG, Local0)
                        Store (Match (Local0, MEQ, GDID, MTR, Zero, Zero), Local1)
                    }
                }
            }

            If (LEqual (Ones, Local1))
            {
                Store (DESK, Local0)
                Store (Match (Local0, MEQ, GDID, MTR, Zero, Zero), Local1)
            }

            If (LNotEqual (Ones, Local1))
            {
                Store (Match (Local0, MEQ, Zero, MTR, Zero, Add (Local1, One)), Local1)
                Store (DerefOf (Index (Local0, Add (Local1, One))), Local0)
                If (CondRefOf (\RMCF.IGPI))
                {
                    If (LNotEqual (Zero, \RMCF.IGPI))
                    {
                        CreateDWordField (DerefOf (Index (Local0, One)), Zero, IGPI)
                        Store (\RMCF.IGPI, IGPI)
                    }
                }

                Return (Local0)
            }

            Return (Package (0x00) {})
        }
    }
}

